{% import "@forms/bootstrap.twig" as form %}

<script type="text/javascript">
    $(document).ready(function() {
        $(".fancybox").fancybox({
            'openEffect': 'elastic',
            'closeEffect': 'elastic',
            helpers : {
                    title : {
                            type : 'inside'
                    }
            }
        });
    });
</script>

<form class="form-horizontal" action='{{ path('admin_page_save') }}' role="form" enctype="multipart/form-data" method='POST'>
    {{ form.input(
        {
            'type': 'hidden',
            'id': 'id',
            'name': 'id',
            'value': id
        }
    ) }}

    {{ form.input(
        {
            'id': 'title',
            'name': 'title',
            'groupClass': 'col-md-5',
            'labelName': 'Заглавие',
            'value': title
        }
    ) }}
    
    {% if app.route.name == 'admin_page_edit' and adminMode == null %}{% set attr = 'disabled' %}{% else %}{% set attr = '' %}{% endif %}
    {{ form.input(
        {
            'id': 'key',
            'name': 'key',
            'groupClass': 'col-md-2',
            'labelName': 'Адрес',
            'value': key,
            'attr': attr
        }
    ) }}

    {{ form.textarea(
        {
            'id': 'content',
            'name': 'content',
            'class': 'mceEditorAdditional',
            'labelName': 'Съдаржание',
            'value': content
        }
    ) }}

    {% include '@forms/metadata.twig' %}
    
    <hr />
    {{ form.submit({backword: 'admin_pages'}) }}
    
    {% include '@forms/multimedia.twig' %}

    {#    <div class="form-group">
            <div class="col-sm-offset-2 col-md-10">
                <div class="checkbox">
                    <label>
                        <input name='rememberMe' type="checkbox"> Remember me
                    </label>
                </div>
            </div>
        </div>#}
</form>